<?php
    /* @var $this CategoryController */
    /* @var $model Category */
    /* @var $form CActiveForm */
?>
<style>
    .row{
        margin: 10px 0px 0px 20px;
    }
</style>
<div class="wide form">

    <?php $form = $this->beginWidget('CActiveForm', array(
    'id'                   => 'category-form',
    'enableAjaxValidation' => FALSE,
)); ?>
<div class="widget-box">
    <div class="widget-content nopadding">

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'parentId'); ?>
        <?php
        $condition = ($model->isNewRecord) ? '' : 'id<>' . $model->id;
        echo $form->dropDownList($model, 'parentId', CHtml::listData(Category::model()->findAll($condition), 'id', 'name'))
        ?>

        <?php echo $form->error($model, 'parentId'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div>
        
    <div class="row">
        <?php echo $form->labelEx($model, 'is_menu_nav'); ?>
        <?php echo $form->checkBox($model, 'is_menu_nav'); ?>
        <?php echo $form->error($model, 'is_menu_nav'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'rank'); ?>
        <?php echo $form->textField($model, 'rank'); ?>
        <?php echo $form->error($model, 'rank'); ?>
    </div>
        
    <div class="row">
        <?php echo $form->labelEx($model, 'url'); ?>
        <?php echo $form->textField($model, 'url', array('size' => 80, 'maxlength' => 255)); ?>
        <?php echo $form->error($model, 'url'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'status'); ?>
        <?php echo $form->checkBox($model, 'status'); ?>
        <?php echo $form->error($model, 'status'); ?>
    </div>
    
    
<!--    <div class="row buttons">
        <?php //echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>-->
    <div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Lưu lại', 'htmlOptions' => array('name' => 'submit'))); ?>
    </div>
    <?php $this->endWidget(); ?>
</div>
    </div>
</div><!-- form -->